package br.com.crednove.paineis;

import br.com.crednove.controle.ControleInicio;
import javax.swing.ImageIcon;

public class PainelInicial extends javax.swing.JFrame {

    private ControleInicio giControle;
    
    public PainelInicial() {
        initComponents();
        this.giControle = new ControleInicio(this.jpnMonte);
        this.setLocationRelativeTo(null);
        setIconImage((new ImageIcon("src/br/com/crednove/imagens/logo.png")).getImage());
    }
    
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jMenuItem7 = new javax.swing.JMenuItem();
        jpnMonte = new javax.swing.JPanel();
        btnImportar = new javax.swing.JButton();
        btnExportar = new javax.swing.JButton();
        btnFiltrar = new javax.swing.JButton();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jmnInicio = new javax.swing.JMenuItem();
        jmnImportar = new javax.swing.JMenuItem();
        jmenuExportar = new javax.swing.JMenuItem();
        jmnFiltrar = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JPopupMenu.Separator();
        jmnLogOut = new javax.swing.JMenuItem();
        jmnHistorico = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        jSeparator3 = new javax.swing.JPopupMenu.Separator();
        jMenuItem2 = new javax.swing.JMenuItem();
        jMenu3 = new javax.swing.JMenu();
        jMenuItem6 = new javax.swing.JMenuItem();
        jSeparator2 = new javax.swing.JPopupMenu.Separator();
        jMenuItem8 = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jMenuItem4 = new javax.swing.JMenuItem();
        jMenuItem5 = new javax.swing.JMenuItem();

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );

        jMenuItem7.setText("jMenuItem7");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("CredNove");
        setResizable(false);

        javax.swing.GroupLayout jpnMonteLayout = new javax.swing.GroupLayout(jpnMonte);
        jpnMonte.setLayout(jpnMonteLayout);
        jpnMonteLayout.setHorizontalGroup(
            jpnMonteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );
        jpnMonteLayout.setVerticalGroup(
            jpnMonteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 417, Short.MAX_VALUE)
        );

        btnImportar.setFont(new java.awt.Font("Calibri", 0, 18)); // NOI18N
        btnImportar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/crednove/imagens/import1.png"))); // NOI18N
        btnImportar.setText("Importar");
        btnImportar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnImportarActionPerformed(evt);
            }
        });

        btnExportar.setFont(new java.awt.Font("Calibri", 0, 18)); // NOI18N
        btnExportar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/crednove/imagens/export1.png"))); // NOI18N
        btnExportar.setText("Exportar");
        btnExportar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnExportarActionPerformed(evt);
            }
        });

        btnFiltrar.setFont(new java.awt.Font("Calibri", 0, 18)); // NOI18N
        btnFiltrar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/crednove/imagens/btnFiltrar.png"))); // NOI18N
        btnFiltrar.setText("Filtrar");
        btnFiltrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnFiltrarActionPerformed(evt);
            }
        });

        jMenuBar1.setFont(new java.awt.Font("Segoe UI", 0, 14)); // NOI18N

        jMenu1.setText("Arquivo");

        jmnInicio.setText("Inicio");
        jmnInicio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmnInicioActionPerformed(evt);
            }
        });
        jMenu1.add(jmnInicio);

        jmnImportar.setText("Importar");
        jmnImportar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmnImportarActionPerformed(evt);
            }
        });
        jMenu1.add(jmnImportar);

        jmenuExportar.setText("Exportar");
        jmenuExportar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmenuExportarActionPerformed(evt);
            }
        });
        jMenu1.add(jmenuExportar);

        jmnFiltrar.setText("Filtrar");
        jmnFiltrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmnFiltrarActionPerformed(evt);
            }
        });
        jMenu1.add(jmnFiltrar);
        jMenu1.add(jSeparator1);

        jmnLogOut.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/crednove/imagens/menuSair.png"))); // NOI18N
        jmnLogOut.setText("Log out");
        jmnLogOut.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmnLogOutActionPerformed(evt);
            }
        });
        jMenu1.add(jmnLogOut);

        jMenuBar1.add(jMenu1);

        jmnHistorico.setText("Ferramentas");

        jMenuItem1.setText("Histórico de importações");
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        jmnHistorico.add(jMenuItem1);
        jmnHistorico.add(jSeparator3);

        jMenuItem2.setText("Configurações");
        jmnHistorico.add(jMenuItem2);

        jMenuBar1.add(jmnHistorico);

        jMenu3.setText("Usuários");

        jMenuItem6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/crednove/imagens/menuPerfil.png"))); // NOI18N
        jMenuItem6.setText("Perfil");
        jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem6ActionPerformed(evt);
            }
        });
        jMenu3.add(jMenuItem6);
        jMenu3.add(jSeparator2);

        jMenuItem8.setText("Gerenciar...");
        jMenuItem8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem8ActionPerformed(evt);
            }
        });
        jMenu3.add(jMenuItem8);

        jMenuBar1.add(jMenu3);

        jMenu2.setText("Ajuda");

        jMenuItem4.setText("Manual");
        jMenu2.add(jMenuItem4);

        jMenuItem5.setText("Suporte Técnico");
        jMenu2.add(jMenuItem5);

        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jpnMonte, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(btnImportar, javax.swing.GroupLayout.PREFERRED_SIZE, 164, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnExportar, javax.swing.GroupLayout.PREFERRED_SIZE, 164, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnFiltrar, javax.swing.GroupLayout.PREFERRED_SIZE, 164, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnImportar, javax.swing.GroupLayout.DEFAULT_SIZE, 63, Short.MAX_VALUE)
                    .addComponent(btnExportar, javax.swing.GroupLayout.DEFAULT_SIZE, 63, Short.MAX_VALUE)
                    .addComponent(btnFiltrar, javax.swing.GroupLayout.DEFAULT_SIZE, 63, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jpnMonte, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(23, 23, 23))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jmnImportarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmnImportarActionPerformed
        this.giControle.mostraPainel(ControleInicio.painelImportar);
    }//GEN-LAST:event_jmnImportarActionPerformed

    private void btnImportarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnImportarActionPerformed
        this.giControle.mostraPainel(ControleInicio.painelImportar);
    }//GEN-LAST:event_btnImportarActionPerformed

    private void btnExportarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExportarActionPerformed
        this.giControle.mostraPainel(ControleInicio.painelExportar);
    }//GEN-LAST:event_btnExportarActionPerformed

    private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed
        
    }//GEN-LAST:event_jMenuItem6ActionPerformed

    private void jMenuItem8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem8ActionPerformed
        new PainelUsuario().setVisible(true);
    }//GEN-LAST:event_jMenuItem8ActionPerformed

    private void btnFiltrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFiltrarActionPerformed
        this.giControle.mostraPainel(ControleInicio.painelFiltrarRefin);
    }//GEN-LAST:event_btnFiltrarActionPerformed

    private void jmenuExportarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmenuExportarActionPerformed
        this.giControle.mostraPainel(ControleInicio.painelExportar);
    }//GEN-LAST:event_jmenuExportarActionPerformed

    private void jmnInicioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmnInicioActionPerformed
        this.giControle.mostraPainel(ControleInicio.painelHome);
    }//GEN-LAST:event_jmnInicioActionPerformed

    private void jmnFiltrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmnFiltrarActionPerformed
        this.giControle.mostraPainel(ControleInicio.painelFiltrarRefin);
    }//GEN-LAST:event_jmnFiltrarActionPerformed

    private void jmnLogOutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmnLogOutActionPerformed
        new PainelLogin().setVisible(true);
        this.dispose();
    }//GEN-LAST:event_jmnLogOutActionPerformed

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        new PainelHistorico().setVisible(true);
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnExportar;
    private javax.swing.JButton btnFiltrar;
    private javax.swing.JButton btnImportar;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem jMenuItem5;
    private javax.swing.JMenuItem jMenuItem6;
    private javax.swing.JMenuItem jMenuItem7;
    private javax.swing.JMenuItem jMenuItem8;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPopupMenu.Separator jSeparator1;
    private javax.swing.JPopupMenu.Separator jSeparator2;
    private javax.swing.JPopupMenu.Separator jSeparator3;
    private javax.swing.JMenuItem jmenuExportar;
    private javax.swing.JMenuItem jmnFiltrar;
    private javax.swing.JMenu jmnHistorico;
    private javax.swing.JMenuItem jmnImportar;
    private javax.swing.JMenuItem jmnInicio;
    private javax.swing.JMenuItem jmnLogOut;
    private javax.swing.JPanel jpnMonte;
    // End of variables declaration//GEN-END:variables
}
